<%= render "menu" %>

<div class="flex-wrap">
  <div class="main-wrap">
    <div class="main-content">
      <div class="dashboard-content">

        <div class="dashboard-section dashboard-docs">
          <% if @recent_docs.blank? %>
            <div class="blankslate no-data no-timeline">
              <div class="mb-3"><%= t(".You have no update Doc in recently_html") %></div>
              <div>
                <%= link_to t(".New Repository"), "/new", class: "btn btn-sm" %>
              </div>
            </div>
          <% else %>
          <div class="subhead"><h2><%= t(".Recent edited docs") %></h2></div>
          <ul class="cards-container recent-docs">
            <%= render(partial: "doc", collection: @recent_docs, as: :item) %>
            <% if @recent_docs.length >= 6 %>
              <%= render "/shared/more_button", url: docs_dashboard_path %>
            <% end %>
          </ul>
          <% end %>
        </div>

        <% if @watched_repositories.present? %>
        <div class="dashboard-section dashboard-watched-repositories">
          <div class="subhead"><h2><%= t(".Watched updates") %></h2></div>
          <div class="wached-repository-groups">
            <% @watched_repositories.each do |repository| %>
              <% docs = @doc_groups[repository.id] %>
              <% if docs.length > 0 %>
              <div class="doc-group card-static mb-4">
                <div class="repository-title"><%= repository_name_tag(repository, with_icon: true) %></div>
                <div class="items">
                  <% if docs.blank? %>
                    <div class="blankslate">
                      <%= t(".No recent updated docs") %>
                    </div>
                  <% else %>
                    <% docs.each do |doc| %>
                      <div class="doc-item">
                        <div class="doc-link"><%= link_to doc.title, doc.to_path %></div>
                        <div class="info mt-1"><%= user_name_tag(doc.last_editor) %> <%= timeago doc.body_updated_at %></div>
                      </div>
                    <% end %>
                  <% end %>
                </div>
              </div>
              <% end %>
            <% end %>
          </div>
        </div>
        <% end %>

        <% if !@recent_issues.blank? %>
        <div class="dashboard-section dashboard-issues">
          <div class="subhead"><h2><%= t(".Recent actived issues") %></h2></div>
          <ul class="list-container recent-issues">
            <%= render(partial: "issue", collection: @recent_issues, as: :item) %>
          </ul>
        </div>
        <% end %>

      </div>
    </div>
  </div>

  <div class="aside-wrap">
    <% if !@groups.blank? %>
    <div class="dashboard-section dashboard-groups">
      <div class="subhead"><h2><%= t(".Your Groups") %></h2></div>
      <div class="group-list">
        <%= render(partial: "group", collection: @groups, as: :group) %>
      </div>
    </div>
    <% end %>

    <div class="dashboard-section dashboard-repositories">
      <div class="subhead"><h2><%= t(".Recent contributed repositories") %></h2></div>
      <% if @recent_repos.blank? %>
        <div class="blankslate">
          <p><%= t(".You have no update Repositories in recently_html") %></p>
          <p>
            <%= link_to t(".New Repository"), "/new", class: "btn btn-sm btn-block" %>
          </p>
        </div>
      <% else %>
      <div class="repo-list">
        <%= render(partial: "repository", collection: @recent_repos, as: :item) %>
        <% if @recent_repos.length >= 12 %>
          <%= render "/shared/more_button", url: repositories_dashboard_path %>
        <% end %>
      </div>
      <% end %>
    </div>

    <%= raw Setting.dashboard_sidebar_html %>
  </div>
</div>